                         VP Main Instructions

==================== Note =================================================

Abbreviations and conventions:

  * Integer numbers are 32 bit
  * Real numbers are 64 bit
  * Integer number sizes: 1, 2 and 4 bytes
  * <vX> : X. item in the stack
  * Par  : Parameter
  * Dsc  : Instruction description in C syntax
  * [vX] : If the parameter is a non zero constant
           then this will be the X. operand of the instruction
  * [X]  : Signed numbers [optional]

==================== Base =================================================

[00] VP controll: "\"
  Par: 0: Halt : End VP
       1: Nop  : Increment IP
       2: Do   : Pop the instruction from the stack

[01] System call: ":"
  Par: system call number

[02] Push register: "<$"
  Par: register number

[03] Pop register: ">$"
  Par: register number

[04] Push unsigned 4 byte number: "#4"
  Par: 4. byte of the number

[05] Push signed 4 byte number: "X4"
  Par: 4. byte of the number

[06] Push next 1 byte of the integer number: "#1"
  Par: 1 byte number
  Dsc: <v1>=(<v1> << 8)|<Par>

[07] Push real 8 byte number: ".8"
  Par: 8. byte of the real number

[08] Push next 1 byte of the real number: ".1"
  Par: 1 byte number
  Dsc: <v1>=(<v1> << 8)|<Par>

[09] Get unsigned value: "#@"
  Par: Number size (1|2|4|8)
  Dsc: <v1>=*<v1>

[0A] Get signed value: "X@"
  Par: Number size (1|2|4|8)
  Dsc: <v1>=*<v1>

[0B] Set value: "="
  Par: Number size (1|2|4|8)
  Dsc: *<v2>=<v1>

[0C] Exchange: "<>"
  Par: Number size (4|8)
  Dsc: <v1>=<v2> , <v2>=<v1>

[0D] Conditional jump: "?@"
  Dsc: IP=<v2> ? <v1> : IP+1

==================== Arithmetic ===========================================

[0E] Negation: '~'
  Dsc: <v1>=-<v1>

[0F] Addition: "+"
  Par: [v1]
  Dsc: <v1>=<v2>+<v1>

[10] Subtraction: "-"
  Par: [v1]
  Dsc: <v1>=<v2>-<v1>

[11-12] Multiplication: "[X]*"
  Par: [v1]
  Dsc: <v1>=<v2>*<v1>

[13-14] Division: "[X]/"
  Par: [v1]
  Dsc: <v1>=<v2>/<v1>

[15-16] Remainder: "[X]%"
  Par: [v1]
  Dsc: <v1>=<v2>%<v1>

==================== Shift ================================================

[17-18] Shift left: "[X]<<"
  Par: [v1]
  Dsc: <v1>=<v2> << <v1>

[19-1A] Shift right: "[X]>>"
  Par: [v1]
  Dsc: <v1>=<v2> >> <v1>

==================== Logical ==============================================

[1B] Bitwise NOT: "!"
  Dsc: <v1>=~<v1>

[1C] Bitwise AND: "&"
  Par: [v2]
  Dsc: <v1>=<v2>&<v1>

[1D] Bitwise OR: "|"
  Par: [v2]
  Dsc: <v1>=<v2>|<v1>

[1E] Bitwise XOR: "^"
  Par: [v2]
  Dsc: <v1>=<v2>^<v1>

==================== Relational ===========================================

[1F] Not null: "?:"
  Dsc: <v1>=(<v1>!=0)

[20] Is null: "?0"
  Dsc: <v1>=(<v1>==0)

[21] Equal: "=="
  Par: [v1]
  Dsc: <v1>=(<v2>==<v1>)

[22] Not equal: "!="
  Par: [v1]
  Dsc: <v1>=(<v2>!=<v1>)

[23-24] Greater: "[X]>"
  Par: [v1]
  Dsc: <v1>=(<v2> > <v1>)

[25-26] Greater or equal: "[X]>="
  Par: [v1]
  Dsc: <v1>=(<v2> >= <v1>)

[27-28] Less: "[X]<"
  Par: [v1]
  Dsc: <v1>=(<v2> < <v1>)

[29-2A] Less or equal: "[X]<="
  Par: [v1]
  Dsc: <v1>=(<v2> <= <v1>)

===========================================================================
